<?php

namespace app\models;


class RedisService
{
    /**
     * @var \Redis
     */
    private static $instance = null;

    public function init(){

       if(!self::$instance) {
           self::$instance = new self();
       }

       return self::$instance;
    }

    /**
     * RedisService constructor.
     */
    public function __construct()
    {

        $redis = new \Redis();
        $redis->connect('127.0.0.1','6379');

        return $redis;
    }
}
